Jx.categorize('unit.color.rgb', {

	$extend: 'unit.color',

	$accessors: {

		red: 0,

		green: 0,

		blue: 0

	},
	
	sets: [ 'red', 'green', 'blue' ],

	ranges: {

		red: 255,

		green: 255,

		blue: 255

	},

	onSetRed: function(operation, value){
		
		this.updateMaskValue(operation.name, value);

	},
	
	onSetGreen: function(operation, value){
		
		this.updateMaskValue(operation.name, value);

	},
	
	onSetBlue: function(operation, value){
		
		this.updateMaskValue(operation.name, value);

	},

	allowSetRed: function(operation, value){

		return this.isValidColor(value, operation.name = 'red');

	},

	allowSetGreen: function(operation, value){

		return this.isValidColor(value, operation.name = 'green');

	},

	allowSetBlue: function(operation, value){

		return this.isValidColor(value, operation.name = 'blue');

	}

});
